package com.tx.axure.tkaxureweb.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author ChenZhaoHui
 * @Date 2022/6/28 00:03
 */
@Getter
@Setter
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class ResultVoMap {
    private Integer error;//0正确
    private String msg;
    private Map data;
    private Exception exception;

    public ResultVoMap() {
        this.error = 0;
        this.msg="success";
        this.data=new HashMap();

    }

    public ResultVoMap(Integer error) {
        this.error = error;
        this.msg="fail";
        this.data=new HashMap();
    }

    public ResultVoMap(Exception e){
        this.error = -1;
        this.msg=e.getMessage();
        this.data=new HashMap();
        this.exception=e;
    }

    public ResultVoMap(Map m){
        this.error = 0;
        this.msg="success";
        this.data=m;
    }
}
